<!DOCTYPE html>
<html th:dir="Itr" lang="en-US"
      xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta th:charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>K3Cloud | 采购对账汇总报表</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../../static/build/css/app.min.css" th:href="${#fn.getStaticFile('/build/css/app.min.css')}">
    <link rel="stylesheet" href="../../static/dist/css/common.css" th:href="${#fn.getStaticFile('/dist/css/common.css')}">
    <link rel="stylesheet" href="../../static/lib/plugins/bootstrap-daterangepicker/daterangepicker.css" th:href="@{/lib/plugins/bootstrap-daterangepicker/daterangepicker.css}" type="text/css" media="all"/>
    <script src="../../static/build/js/app.min.js" th:src="${#fn.getStaticFile('/build/js/app.min.js')}"></script>
    <script src="../../static/dist/js/common.js" th:src="${#fn.getStaticFile('/dist/js/common.js')}"></script>
    <script src="../../static/lib/plugins/bootstrap-daterangepicker/moment.js" th:src="${#fn.getStaticFile('/lib/plugins/bootstrap-daterangepicker/moment.js')}" type="text/javascript"></script>
    <script src="../../static/lib/plugins/bootstrap-daterangepicker/daterangepicker.js" th:src="${#fn.getStaticFile('/lib/plugins/bootstrap-daterangepicker/daterangepicker.js')}" type="text/javascript"></script>
     <script type="text/javascript">
        $(document).ready(function () {
            var companyName = $("#companyName").val();
            var dateRange = $("#dateRange").val();
            $(".dataTable").DataTable();
        })
    </script>
</head>
<body class="hold-transition skin-blue sidebar-mini " th:classappend="${#session.getAttribute('sidebarClass')}" th:with="pageCode='purchaseSummaryReconciliationReport'">
<div Class="wrapper">
    <div th:replace="fragment/layout :: header"></div>
    <!-- Left side column. contains the logo and sidebar -->
    <div th:replace="fragment/layout :: menu(activePageCode=${pageCode})"></div>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Main content -->
        <section class="content">
            <ul th:replace="fragment/menuTab :: menuTab(activePageCode=${pageCode})"></ul>
            <div class="panel panel-info" style="padding: 10px">
                <div class="panel_body">
                    <form class="form-inline pull-left" role="form" th:action="@{/cloud/summaryReconciliationReport/purchaseSummaryList}" method="get">
                        <div class="form-group">
                            <label for="dateRange">日期</label>
                            <input type="text" id="dateRange" name="dateRange"  class="form-control dateRange"  th:value="${dateRange}" readonly="readonly"  style="width:200px;" />
                            <label for="companyName">账套</label>
                            <select name="companyName" id="companyName" class="form-control" style="width:180px;">
                                <option th:value="null" th:text="请选择账套"></option>
                                <option th:each="item : ${clouds}" th:value="${item}" th:text="${item}" th:selected="${companyName==item}">cloud</option>
                            </select>
                            <label for="supply" style="margin-left: 10px">供应商</label>
                            <input type="checkbox" id="supply" name="masterStr"/>
                            <label for="department" style="margin-left: 10px">部门</label>
                            <input type="checkbox" id="department" name="departmentStr" />
                            <label for="material" style="margin-left: 10px">物料</label>
                            <input type="checkbox" id="material" name="materialStr"/>
                            <button type="submit" class="btn btn-success">
                                <span class="glyphicon glyphicon-search"></span>搜索
                            </button>
                        </div>
                    </form>
                    <button class="btn pull-right btn-info" data-toggle="modal" id="btnFilter" href="#search-modal">
                        <span class="glyphicon glyphicon-cloud-download"></span>导出（选择）
                    </button>
                </div>
                <div class="panel-body" style="margin-top: 50px">
                    <div class="pageable-table" data-search-form="#search-form">
                        <table class="table table-bordered table-striped dataTable">
                            <thead>
                            <tr role="row">
                                <th th:if="${masterStr} eq 'on'">供应商编码</th>
                                <th th:if="${masterStr} eq 'on'">供应商名称</th>
                                <th th:if="${departmentStr} eq 'on'">门店编码</th>
                                <th th:if="${departmentStr} eq 'on'">门店名称</th>
                                <th th:if="${materialStr} eq 'on'">物料编码</th>
                                <th th:if="${materialStr} eq 'on'">物料名称</th>
                                <th>数量</th>
                                <th>金额</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="summary:${purchaseSummaryReconciliationReport}">
                                <td th:if="${summary.masterId} ne null" th:text="${summary.masterId}">00</td>
                                <td th:if="${summary.masterName} ne null" th:text="${summary.masterName}">00</td>
                                <td th:if="${summary.departmentId} ne null" th:text="${summary.departmentId}">00</td>
                                <td th:if="${summary.departmentName} ne null" th:text="${summary.departmentName}">00</td>
                                <td th:if="${summary.materialId} ne null" th:text="${summary.materialId}">00</td>
                                <td th:if="${summary.materialName} ne null" th:text="${summary.materialName}">00</td>
                                <td th:text="${#numbers.formatDecimal(summary.quantity,1,0)}"></td>
                                <td th:text="${#numbers.formatDecimal(summary.amount,1,2)}"></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <footer th:replace="fragment/layout :: footer"></footer>
</div>
</body>
</html>